<% title @project.name %>

<% subtitle 'Owned by ' + @project.owner.name %>

<%= simple_format h(@project.description) %>

<% if @project.milestones.size == 0 and @project.activities.size == 0 %>

	<div class="alert green center rounded-8">
		<h1><%= link_to "Create a new milestone", new_project_milestone_path(@project) %></h1>
		<p>Seu projeto ainda não contém nenhuma etapa, você pode inicia-lo criando uma.</p>
	</div>
	
	<div class="alert gray center rounded-8">
		<h1><%= link_to "Adcionar novos membros", new_project_milestone_path(@project) %></h1>
		<p>Você pode também adcionar mais pessoas ao seu projeto.</p>
	</div>
	
<% else %>

<hr />

<%= render :partial => "milestones/table", :locals => {:label => t(:late, :scope => :milestone),
													   :milestones => @late_milestones}%>

<table class="basic-table fluid">
	<thead>
		<tr>
			<th colspan="2" class="header-left left top-left-rounded-8">
				Atualizações Recentes
			</th>
			<th class="header-right top-right-rounded-8 width-150"></th>
		</tr>
	</thead>
	<tbody>
	<% for log in @project.logs.all(:order => "created_at DESC", :limit => 20) %>
		<tr>
			<td class="width-50"><span class="mini-alert darkest width-50 rounded-4"><%= log.loggable_type %></span></td>
			<td class="left"><%= log.action %> um novo <%= log.loggable_type %> chamado <%= link_to log.loggable.title, polymorphic_url([@project, log.loggable]) %></td>
			<td><%= time_ago_in_words log.created_at %></td>
		</tr>
	<% end %>
	</tbody>
</table>
<% end %>